package com.wellink.tabhostdemo;

import android.app.TabActivity;
import android.os.Bundle;
import android.widget.TabHost;

public class TabHostTabActivity extends TabActivity {
    TabHost tabHost;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.tabhost_layout);

        tabHost = getTabHost();
        TabHost.TabSpec tab1 = tabHost.newTabSpec("0");
        tab1.setIndicator("红色");
        tab1.setContent(R.id.red);
        tabHost.addTab(tab1);

        tabHost.addTab(tabHost.newTabSpec("1").setIndicator("绿色").setContent(R.id.green));

        tabHost.addTab(tabHost.newTabSpec("2").setIndicator("蓝色").setContent(R.id.blue));
    }
}
